package com.hnas.core.jms;

/**
 * 
 * @author 郑兴(zhengxing)
 *
 */
public abstract class JobArtifact implements java.io.Serializable {

	private static final long serialVersionUID = 1L;
	private String operation;
	private String messageType;
	private String airline;
	
	private boolean sucess = false;
	private int retry;
	
	
	private int operateTimes=0;//操作次数
	
	
	public JobArtifact(String operation, String messageType,String airline) {
		super();
		this.operation = operation;
		this.messageType = messageType;
		this.airline=airline;
	}



	/**
	 * a descriptive name describing this type of operation.
	 * @return
	 */
	public String getOperation() {
		return operation;
	}



	public void setOperation(String operation) {
		this.operation = operation;
	}


	/**
	 * a descriptive name describing this type of message.
	 * @return
	 */
	public String getMessageType() {
		return messageType;
	}



	public void setMessageType(String messageType) {
		this.messageType = messageType;
	}	

	/**
	 * @return the operateTimes
	 */
	public int getOperateTimes() {
		return this.operateTimes;
	}



	/**
	 * @param operateTimes the operateTimes to set
	 */
	public void setOperateTimes(int operateTimes) {
		this.operateTimes = operateTimes;
	}
	
	public void operateTimeAdded(){
		operateTimes++;
	}



	/**
	 * @return the airline
	 */
	public String getAirline() {
		return this.airline;
	}



	/**
	 * @param airline the airline to set
	 */
	public void setAirline(String airline) {
		this.airline = airline;
	}



	/**
	 * override to provide a meaningful text for storing into db 
	 * whenever an exception occurs.
	 */
	public abstract String toString();



	public boolean isSucess() {
		return sucess;
	}



	public void setSucess(boolean sucess) {
		this.sucess = sucess;
	}



	public int getRetry() {
		return retry;
	}



	public void setRetry(int retry) {
		this.retry = retry;
	}

}
